<?php

class CHCAxisTitle extends AbstractHCObject
{
    
    /**
     * Alignment of the title relative to the axis values. Possible values are "low", "middle" or "high". Defaults to "middle".
     * 
     * @param String $psString
     * @return string|string
     */
    public function setAlign($psString)
    {
        if (CSDebug::assertString($psString)) return false;
        if (!in_array($psString, array('low', 'middle', 'high'))) return false;
        
        $this->setParam('align', $psString);
    }
    
    
    /**
     * Enable or disable the axis title. Defaults to false.
     * 
     * @param $pbBool
     */
    public function setEnabled($pbBool=true)
    {
        if (CSDebug::assertBoolean($pbBool)) return false;
        
        $this->setParam('enabled', $pbBool);
    }
    
    
    public function setMargin($pnNumber)
    {
        if (CSDebug::assertNumber($pnNumber, true)) return false;
        
        $this->setParam('margin', $pnNumber);
    }
    
    
 	/**
     * The rotation of the text in degrees. 0 is horizontal, 270 is vertical reading from bottom to top. Defaults to 0.
     * 
     * @param Float $pnNumber
     */
    public function setRotation($pnNumber)
    {
        if (CSDebug::assertNumber($pnNumber, true)) return false;
        
        $this->setParam('rotation', $pnNumber);
    }
    
    
    /**
     * CSS styles for the title. 
     * When titles are rotated they are rendered using vector graphic techniques and not all styles are applicable. 
     * Most noteworthy, a bug in IE8 renders all rotated strings bold and italic. 
     * 
     * Defaults to: 
     * 
     * array
     * (
     * 		color: '#6D869F',
	 *		font: 'bold 12px "Lucida Grande", "Lucida Sans Unicode", 'Verdana, Arial, Helvetica, sans-serif'
     * );
     * 
     * @param $pasArray
     */
    public function setStyle($pasArray)
    {
        if (CSDebug::assertArray($pasArray, true)) return false;
        
        $this->setParam('style', $pasArray);
    }
    
    
    /**
     * The actual text of the axis title. 
     * Horizontal texts can contain HTML, but rotated texts are painted 
     * using vector techniques and must be clean text. Defaults to "X-values".
     * 
     * @param $psString
     */
    public function setText($psString)
    {
        if (CSDebug::assertString($psString)) return false;
        
        $this->setParam('text', $psString);
    }
}

?>